package de.bazinga.rotw.network.message;

import com.captiveimagination.jgn.message.Message;
import com.captiveimagination.jgn.message.type.CertifiedMessage;
import com.captiveimagination.jgn.message.type.PlayerMessage;
import com.captiveimagination.jgn.message.type.TimestampedMessage;

import de.bazinga.rotw.game.RotwGameState;

public class KilledOppMessage extends Message implements CertifiedMessage, PlayerMessage, TimestampedMessage, GameMessage {
	/**
	 * The Name of the player you killed
	 */
	String playerName = "";

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	
	public void handleMessage(RotwGameState game, Message msg, boolean server) {
		if(!(msg instanceof KilledOppMessage)) return ;
		
		KilledOppMessage message = (KilledOppMessage)msg;
		
		if(!server) {
			game.getPlayer().killedOpponent(message.getPlayerName());
		}
	}
	
	
}